/**
 * 
 */
package com.mes.basicdata.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;

/**
 * <p>
 * 对应了原来的EmployeeResource对象
 * </p>
 * 
 * <p>
 * Created on 2017-03-14
 * </p>
 * 
 * @author lcs
 * 
 */

@Entity()
@Table(name = "R_EMPLOYEE_RESOURCE")
@BatchSize(size=20)
@Lazy(value=true)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class EmployeeDeviceCertification extends Certification {
	
	@Id
	@GenericGenerator(name = "UUID", strategy = "assigned")
	@Column(name="UUID")
	private String uuid;
	
	// 人员
	@Column(name="EMPLOYEEID")
	private String employeeId;
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="EMPLOYEEID",insertable=false,updatable=false)
	private Employee employee;
	
	// 设备
	@Column(name="RESUID")
	private String deviceUid;
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="RESUID",insertable=false,updatable=false)
	private Device device;
	
	// 操作许可类型
	@Column(name="LICENSETYPE")
	private String licenseType;

	public String getEmployeeId() {
		return employeeId;
	}

	public void setEmployeeId(String employeeId) {
		this.employeeId = employeeId;
	}

	public String getDeviceUid() {
		return deviceUid;
	}

	public void setDeviceUid(String deviceUid) {
		this.deviceUid = deviceUid;
	}

	public String getLicenseType() {
		return licenseType;
	}

	public void setLicenseType(String licenseType) {
		this.licenseType = licenseType;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public Device getDevice() {
		return device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

}
